<script setup lang="ts">
import {ref} from "vue"
import type {tabInterface, tabStyle} from "@/interfaces/movie-tag"

export interface PropsInterface {
  list: tabInterface[]
}

const {list} = defineProps<PropsInterface>()
const emits = defineEmits<{
  (e:'onClick',type:number):void
}>()
const activeStyle = ref<tabStyle>({
  color: "#E5857B"
})
const inactiveStyle = ref<tabStyle>({
  color: "#ffffff"
})
/**
 * 处理标签的点击事件
 */
const handleClick = (e: any) => {
  emits("onClick",e.value)
}
</script>

<template>
  <view>
    <u-tabs :list="list" @click="handleClick" :activeStyle="activeStyle" :inactiveStyle="inactiveStyle"
            keyName="label"></u-tabs>
  </view>
</template>

<style scoped>

</style>